﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

//Write a program that finds the greatest of given 5 variables.

namespace _07GreatestOfFive
{
    class _07GreatestOfFive
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter five real numbers:");
            Console.Write("a = ");
            string firstValue = Console.ReadLine();
            decimal a = decimal.Parse(firstValue);
            Console.Write("b = ");
            string secondValue = Console.ReadLine();
            decimal b = decimal.Parse(secondValue);
            Console.Write("c = ");
            string thirdValue = Console.ReadLine();
            decimal c = decimal.Parse(thirdValue);
            Console.Write("d = ");
            string fourthValue = Console.ReadLine();
            decimal d = decimal.Parse(fourthValue);
            Console.Write("e = ");
            string fifthValue = Console.ReadLine();
            decimal e = decimal.Parse(fifthValue);

            if ((a >= b) && (a >= c) && (a >= d) && (a >= e))
            {
                Console.WriteLine("The greatest number is {0}", a);
            }
            else if ((b >= a) && (b >= c) && (b >= d) && (b >= e))
            {
                Console.WriteLine("The greatest number is {0}", b);
            }
            else if ((c >= a) && (c >= b) && (c >= d) && (c >= e))
            {
                Console.WriteLine("The greatest number is {0}", c);
            }
            else if ((d >= a) && (d >= b) && (d >= c) && (d >= e))
            {
                Console.WriteLine("The greatest number is {0}", d);
            }
            else if ((e >= a) && (e >= b) && (e >= c) && (e >= d))
            {
                Console.WriteLine("The greatest number is {0}", e);
            }

            Console.ReadLine();
        }
    }
}
